import java.util.Scanner;
public class Homework_02 {

	public static void main(String[] args) {
		Scanner reader=new Scanner(System.in);
		int n=1;
		while(n<=10)//实现多次循环输入
		{
			System.out.printf("请输入用电量：>");
			int x=reader.nextInt();
			double sum=0;
			if(x>=0)//判断输入数值的合法性
			{
				//分段计算电费
				if(x<=50)
				{
					sum=0.55*x;
				}
				else if(x>50 && x<=220)
				{
					sum=(0.55*50)+(0.58*x);
				}
				else if(x>220)
				{
					sum=(0.55*50)+(0.58*(220-50))+(0.65*(x-220));
				}
				//输入应缴纳的电费
				System.out.printf("第%d个用户应缴的电费为%f\n",n,sum);
				n++;
			}
			else
			{
				System.out.printf("输入错误！");
			}
		}
	}

}
